//
//  SXWeatherMoreTableViewCell.m
//  ShiXun
//
//  Created by lanou on 15/11/4.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXWeatherMoreTableViewCell.h"

@implementation SXWeatherMoreTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, kScreenWidth / 2 - 10, 20)];
        _dateLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_dateLabel];
        
        _weatherLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth / 2, 5, kScreenWidth / 2 - 10, 20)];
        _weatherLabel.font = [UIFont systemFontOfSize:15];
        _weatherLabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_weatherLabel];
        
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)setConfigureModel:(SXWeatherMoreModel *)configureModel
{
    _configureModel = configureModel;
    
    NSString *date = [configureModel.date substringFromIndex:5];
    NSString *week = [NSString stringWithFormat:@"星期%@", configureModel.week];
    
    NSString *temp = [NSString stringWithFormat:@"%@~%@°", configureModel.lowTemp, configureModel.hightTemp];
    
    _dateLabel.text = [NSString stringWithFormat:@"%@ %@", date, week];
    
    _weatherLabel.text = [NSString stringWithFormat:@"%@ %@", configureModel.info, temp];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
